package lab02.test03;

public class Student {
    //属性:计算机成绩、数学成绩、英语成绩
    float computerScore;
    float mathScore;
    float englishsccore;
    //行为：求总分、平均分、最高分、最低分，并且可以输出一个学生的完整信息
    float sum(){
        return computerScore+mathScore+englishsccore;
    }
    float average(){
        return(computerScore+mathScore+englishsccore)/3;
    }
    float maxScore(){
         if (computerScore>mathScore&&computerScore>englishsccore)
            return computerScore;
        else if (mathScore>englishsccore&&mathScore>computerScore)
            return mathScore;
        else return englishsccore;
    }
    float minScore(){
        if (computerScore<mathScore&&computerScore<englishsccore)
            return computerScore;
        else if (mathScore<computerScore&&mathScore<englishsccore)
            return mathScore;
        else return englishsccore;
    }
    void pintStudent(){
        System.out.println("计算机成绩" + computerScore);
        System.out.println("数学成绩" + mathScore);
        System.out.println("英语成绩" + englishsccore);
        System.out.println("总分" + sum());
        System.out.println("平均分" + average());
        System.out.println("最高分" + maxScore());
        System.out.println("最低分" + minScore());
    }

}
